#include <iostream>

using namespace std;

int main(){
	unsigned int i,d,count,e;
	cin >> i;
	while(i--){
		count=0;
		cin >> d;
		while(d>0){
			if(d&1){
				cout << ((e)?" ":"") << count;
				e=1;
			}
			d=d>>1;
			count++;
		}
		cout << endl;
		e=0;

	}
}
